<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>
	<? if($template->isSearch()) { ?>
		<?= $config['site_name'] ?> | Søgning
	<? } else if ($template->isPage() && $template->isPageFound()) { ?>
		<?= $config['site_name'] ?> | <?= $template->getTitle() ?>
	<? } else { ?>
		<?= $config['site_name'] ?> | Siden kunne ikke findes
	<? } ?>
</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="<?= $template->getPath('style/default.css') ?>">
</head>
<body>
<div id="wrapper">
  <div id="content">
    <div id="logo">
    	<a href="<?= page_link($config['site_index']) ?>"><h1><?= $config['site_name'] ?></h1></a>
    </div>
    <div id="nav">
    	<ul>
    		<? if (count($template->getMenu()) > 0) { ?>
				<? foreach($template->getMenu() as $p) { ?>
					<li><a href="<?= page_link($p['name']) ?>"><?= $p['title'] ?></a></li>
				<? } ?>
			<? } ?>
    	</ul>
    </div>
    <div id="main">
      	<? if($template->isPage() && $template->isPageFound()) { ?>
			
			<h2><?= $template->getTitle() ?></h2>
			<p><?= $template->getText() ?></p>
			<p class="page_info">
				Skrevet af <?= $template->getAuthor() ?> - <?= $template->getTimestamp() ?>
			</p>
			
		<? } else if ($template->isPage() && !$template->isPageFound()) { ?>
			
			<span>
				<b>Siden kunne ikke findes!</b><br/>
				<a href="<?= page_link($config['site_index']) ?>">Klik her</a> for at gå til forsiden.
			</span>
			
		<? } else if ($template->isSearch()) { ?>
			<div class="search_info"><b>Søgning</b> - søgning på ordet "<? echo $template->getQuery() ?>" - 
				<? echo ($template->getResults() != null) ? count($template->getResults()) : 0 ?> resultat(er)
			</div>
			<div>
				<? if ($template->getResults() != null && count($template->getResults()) > 0) { ?>
					<? foreach ($template->getResults() as $r) { ?>
						<div class="search_result" 
							onclick="document.location.href='<? echo page_link($r[name]) ?>'"
							style="cursor: pointer">
							<? echo $r['title'] ?>
						</div>
					<? } ?>
				<? } else { ?>	

				<? } ?>
			</div>
		<? } ?>
    </div>
	<div id="footer">
 		<small><a href="admin">Admin</a> | Powered by <b>KomitCMS <? echo VERSION ?></b> &copy 2009 Jacob Friis Pedersen</small>
  	</div>
</div>
<div id="resources">
  <div id="resources_content">
   	
    <div class="clear"></div>
  </div>
</div>
</body>
</html>
